<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
	<title class="tit">资讯详情</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	<style type="text/css">
		.tit{
			color: rgba(255, 255, 255, 1);
		}
		.zixun_footer {
			width: 18.75rem;
			height: 2.7rem;
			background: rgba(255, 255, 255, 1);
			position: fixed;
			bottom: 0;
			display: flex;
			justify-content: space-between;
			padding: 0 1.5rem;
			align-items: center;
			border-top: 1px solid rgba(238, 238, 238, 0.5);
		}

		.zixun_footer img {
			width: 1.1rem;
			height: 1.1rem;
			margin-right: 0.15rem;
		}
		.zixun_footer>div{
			display:flex;
			align-items:center;
		}

		.footer_icon_cont {
			font-size: 0.7rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(0, 90, 147, 1);
			margin-left: 0.2rem;
			margin-top: 0.2rem;
		}

		/*新加样式*/
		.imgBack{
			width: 1rem;
			height: 1rem;
			margin-top: 0.5rem;
		}
		.imgShare{
			width: 2rem;
			height: 2rem;
		}
		.zanImg{
			width: 0.5rem;
			height: 0.5rem;
		}
		.infoTitle{
			font-size:0.9rem;
			font-family:PingFangSC-Regular;
			font-weight:400;
			color:rgba(255, 255, 255, 1);
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
		}
	</style>
</head>

<body>
	<div id="aui-wraper">
		<div id="aui-header" class="ming-bg-blue">
			<header class="aui-bar aui-bar-nav ming-bg-blue aui-border-b" >
				<a class="aui-pull-left" tapmode onclick="close_win()" style="margin-left:.75rem;padding:0;">
					<img class="imgBack" src="../../image/btn/btn-back.png" />
				</a>
				<div class="aui-title">
					<div v-if="status" class="infoTitle">
						{{info.title}}
					</div>
				</div>
				<a class="aui-pull-right" tapmode onclick="share()" style="margin-right:.75rem;padding:0;">
					<img class="imgShare" src="../../image/btn/dots.png" />
				</a>
			</header>
		</div>

		<!-- 底部 -->
		<div class="zixun_footer" id="aui-footer" v-cloak="">
			<div tapmode onclick=" thumbs(2)">
				<img v-if="info.is_zan=='0'" src="../../image/icon/icon-zan.png" class="zanImg"/>
				<img v-if="info.is_zan=='1'" src="../../image/icon/icon-zan-active.png" />
				<span class="footer_icon_cont">{{info.zan_num}}</span>
			</div>

			<div tapmode onclick="openchatbox_f()" style="margin-top:0.2rem;">
				<img src="../../image/icon/news_detail.png" />
				<span class="footer_icon_cont">{{info.comment_num}}</span>
			</div>

			<div tapmode onclick="collection()">
				<img v-if="info.is_fav=='0'" src="../../image/icon/star_detail.png" />
				<img v-if="info.is_fav=='1'" src="../../image/icon/icon-fav-active.png" />
				<span class="footer_icon_cont">{{info.collect_num}}</span>
			</div>
			<!-- <div v-if="info.catid=='2'&&info.uid!=uid" tapmode onclick="shareTorp()">
				<div>举报</div>
			</div> -->
		</div>
	</div>

</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script>
	var vm = new Vue({
		el: "#aui-wraper",
		data: {
			amount: 0,
			id: '',
			info: {},
			status:0,
			index:0
		},
		methods: {
			get_list: function() {
				get_data('api/xiaoyouquan/xyqDetail', {
					token: $api.getStorage('token'),
					id: vm.id
				}, function(ret) {
				//	alert(JSON.stringify(ret.data))
					if (ret.status) {
						vm.info = ret.data
					}

				})
			}
		}
	})

	apiready = function() {
		vm.id = $api.getStorage('id')
		vm.status = $api.getStorage('status')
		vm.index = $api.getStorage('index')
		if(vm.status == '资讯详情'){
			vm.status = '资讯详情'
		}else{
			vm.status = '发布详情'
		}

		vm.get_list();
		$api.fixStatusBar($api.byId('aui-header'));
		open_frame_f('circle_details_f', 'circle_details_f.html', 'aui-header', 'aui-footer', false);
		// add_event('ll',function () {
		// 	opera_data(2);
		// })
	};

	function share() {
		send_event('share_zixun')
	}

	function openSharebox() {
		send_event('share_zixun')
	}

	// 收藏
	function collection(type) {
		// send_event('is_collection')
		var source = vm.info.catid == '1' ? 'xx' : 'xyx'
		opera(vm.id, source, 2, function(ret) {
			if (ret.status) {
				toast(ret.msg)
				vm.get_list()
				if(vm.info.is_fav == '1'){
					send_event('collection_cancel',{
						circle_index:vm.index
					});
				}else {
					send_event('collection_new',{
						circle_index:vm.index
					});
				}
			}
		})
	}
	function thumbs(type) {
		var source = vm.info.catid == '1' ? 'xx' : 'xyx'
		opera(vm.id, source, 1, function(ret) {
			if (ret.status) {
				toast(ret.msg)
				vm.get_list()
				// send_event('refresh_collection_thumbs',function () {
				//
				// });
				if(vm.info.is_zan == '1'){
					send_event('thumbs_cancel',{
						circle_index:vm.index
					});
				}else {
					send_event('thumbs_new',{
						circle_index:vm.index
					});
				}
			}
		})
	}
function openchatbox_f() {
	send_event('open_chatbox');
	add_event('comments',function(){
		vm.info.comment_num++
	})
	// vm.info.comment_num++
}

</script>

</html>
